package utils
{
	import flash.display.*;

	public class GetColorAlpha
	{
		public function GetColorAlpha()
		{
		}
		
		public static function getColorAlpha(target:DisplayObject,x:Number,y:Number):Number
		{
			var pixelValue:uint;
			var alphaValue:uint;
			var bmpd:BitmapData
			if(target is Bitmap)
			{
				bmpd=Bitmap(target).bitmapData;
				pixelValue = bmpd.getPixel32(x, y);
			}
			else if(target is Sprite || target is MovieClip)
			{
				bmpd=BitMapMethod.setBitmap(target).bitmapData;
			}
			alphaValue = pixelValue >> 24 & 0xFF;
			return alphaValue;
		}
	}
}